package com.jxw.cidiansdkdemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;

import androidx.annotation.Nullable;

public class DialogueLauncher extends Activity implements Constant{
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_launcher);
    }

    public void onClick(View view){
        Intent intent = new Intent(this, DicActivity.class);
        switch (view.getId()){
            case R.id.btn_yinghan:
                //英汉词典
                intent.putExtra("dic_type",TYPE_XWCD);
                break ;
            case R.id.btn_hanzi:
                intent.putExtra("dic_type",TYPE_HZZD);
                break ;
            case R.id.btn_hanyu:
                intent.putExtra("dic_type",TYPE_HYCD);
                break ;
            case R.id.btn_chengyu:
                intent.putExtra("dic_type",TYPE_CYCD);
                break ;
            case R.id.btn_gushiwen:
                intent.putExtra("dic_type",TYPE_GSWCD);
                break ;
            case R.id.btn_pinyinku:
                intent.putExtra("dic_type",TYPE_PYK);
                break ;
        }
        startActivity(intent);
    }

    //demo数据
    String book_path = Environment.getExternalStorageDirectory().getAbsolutePath()
            + "/同步听力/广州版小学英语口语第一册JWAR_ISBN9787546202846.JWAR";

    public void onClickTBTL(View view){
        Intent intent = new Intent(this, TBTLActivity.class);
        intent.putExtra("book_path",book_path);
        switch (view.getId()){
            case R.id.btn_zhengdu:
                //同步整读内容
                intent.putExtra("isWord",false);
                break ;
            case R.id.btn_word:
                //同步单词内容
                intent.putExtra("isWord",true);
                break ;
        }
        startActivity(intent);
    }
}
